package com.kexio.pay.dto;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 支付请求DTO
 * 
 * @author Kexio Team
 * @since 1.0.0
 */
public class PaymentRequest {
    
    /**
     * 订单号
     */
    private String orderNo;
    
    /**
     * 业务类型
     */
    private String businessType;
    
    /**
     * 业务ID
     */
    private String businessId;
    
    /**
     * 用户ID
     */
    private String userId;
    
    /**
     * 支付金额
     */
    private BigDecimal amount;
    
    /**
     * 订单标题
     */
    private String subject;
    
    /**
     * 订单描述
     */
    private String body;
    
    /**
     * 支付方式
     */
    private String paymentMethod;
    
    /**
     * 支付场景
     */
    private String paymentScene;
    
    /**
     * 客户端IP
     */
    private String clientIp;
    
    /**
     * 用户代理
     */
    private String userAgent;
    
    /**
     * 过期时间
     */
    private LocalDateTime expireTime;
    
    /**
     * 异步通知地址
     */
    private String notifyUrl;
    
    /**
     * 同步跳转地址
     */
    private String returnUrl;
    
    /**
     * 微信openid (微信JSAPI支付需要)
     */
    private String openid;
    
    /**
     * 支付宝买家ID (支付宝某些场景需要)
     */
    private String buyerId;
    
    /**
     * 扩展参数
     */
    private String extraData;
    
    /**
     * 租户ID
     */
    private String tenantId;
    
    // Constructors
    public PaymentRequest() {}
    
    private PaymentRequest(Builder builder) {
        this.orderNo = builder.orderNo;
        this.businessType = builder.businessType;
        this.businessId = builder.businessId;
        this.userId = builder.userId;
        this.amount = builder.amount;
        this.subject = builder.subject;
        this.body = builder.body;
        this.paymentMethod = builder.paymentMethod;
        this.paymentScene = builder.paymentScene;
        this.clientIp = builder.clientIp;
        this.userAgent = builder.userAgent;
        this.expireTime = builder.expireTime;
        this.notifyUrl = builder.notifyUrl;
        this.returnUrl = builder.returnUrl;
        this.openid = builder.openid;
        this.buyerId = builder.buyerId;
        this.extraData = builder.extraData;
        this.tenantId = builder.tenantId;
    }
    
    /**
     * 创建Builder
     */
    public static Builder builder() {
        return new Builder();
    }
    
    /**
     * Builder模式
     */
    public static class Builder {
        private String orderNo;
        private String businessType;
        private String businessId;
        private String userId;
        private BigDecimal amount;
        private String subject;
        private String body;
        private String paymentMethod;
        private String paymentScene;
        private String clientIp;
        private String userAgent;
        private LocalDateTime expireTime;
        private String notifyUrl;
        private String returnUrl;
        private String openid;
        private String buyerId;
        private String extraData;
        private String tenantId;
        
        public Builder orderNo(String orderNo) {
            this.orderNo = orderNo;
            return this;
        }
        
        public Builder businessType(String businessType) {
            this.businessType = businessType;
            return this;
        }
        
        public Builder businessId(String businessId) {
            this.businessId = businessId;
            return this;
        }
        
        public Builder userId(String userId) {
            this.userId = userId;
            return this;
        }
        
        public Builder amount(BigDecimal amount) {
            this.amount = amount;
            return this;
        }
        
        public Builder subject(String subject) {
            this.subject = subject;
            return this;
        }
        
        public Builder body(String body) {
            this.body = body;
            return this;
        }
        
        public Builder paymentMethod(String paymentMethod) {
            this.paymentMethod = paymentMethod;
            return this;
        }
        
        public Builder paymentScene(String paymentScene) {
            this.paymentScene = paymentScene;
            return this;
        }
        
        public Builder clientIp(String clientIp) {
            this.clientIp = clientIp;
            return this;
        }
        
        public Builder userAgent(String userAgent) {
            this.userAgent = userAgent;
            return this;
        }
        
        public Builder expireTime(LocalDateTime expireTime) {
            this.expireTime = expireTime;
            return this;
        }
        
        public Builder notifyUrl(String notifyUrl) {
            this.notifyUrl = notifyUrl;
            return this;
        }
        
        public Builder returnUrl(String returnUrl) {
            this.returnUrl = returnUrl;
            return this;
        }
        
        public Builder openid(String openid) {
            this.openid = openid;
            return this;
        }
        
        public Builder buyerId(String buyerId) {
            this.buyerId = buyerId;
            return this;
        }
        
        public Builder extraData(String extraData) {
            this.extraData = extraData;
            return this;
        }
        
        public Builder tenantId(String tenantId) {
            this.tenantId = tenantId;
            return this;
        }
        
        public PaymentRequest build() {
            return new PaymentRequest(this);
        }
    }
    
    // Getters and Setters
    public String getOrderNo() { return orderNo; }
    public void setOrderNo(String orderNo) { this.orderNo = orderNo; }
    
    public String getBusinessType() { return businessType; }
    public void setBusinessType(String businessType) { this.businessType = businessType; }
    
    public String getBusinessId() { return businessId; }
    public void setBusinessId(String businessId) { this.businessId = businessId; }
    
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }
    
    public BigDecimal getAmount() { return amount; }
    public void setAmount(BigDecimal amount) { this.amount = amount; }
    
    public String getSubject() { return subject; }
    public void setSubject(String subject) { this.subject = subject; }
    
    public String getBody() { return body; }
    public void setBody(String body) { this.body = body; }
    
    public String getPaymentMethod() { return paymentMethod; }
    public void setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; }
    
    public String getPaymentScene() { return paymentScene; }
    public void setPaymentScene(String paymentScene) { this.paymentScene = paymentScene; }
    
    public String getClientIp() { return clientIp; }
    public void setClientIp(String clientIp) { this.clientIp = clientIp; }
    
    public String getUserAgent() { return userAgent; }
    public void setUserAgent(String userAgent) { this.userAgent = userAgent; }
    
    public LocalDateTime getExpireTime() { return expireTime; }
    public void setExpireTime(LocalDateTime expireTime) { this.expireTime = expireTime; }
    
    public String getNotifyUrl() { return notifyUrl; }
    public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; }
    
    public String getReturnUrl() { return returnUrl; }
    public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; }
    
    public String getOpenid() { return openid; }
    public void setOpenid(String openid) { this.openid = openid; }
    
    public String getBuyerId() { return buyerId; }
    public void setBuyerId(String buyerId) { this.buyerId = buyerId; }
    
    public String getExtraData() { return extraData; }
    public void setExtraData(String extraData) { this.extraData = extraData; }
    
    public String getTenantId() { return tenantId; }
    public void setTenantId(String tenantId) { this.tenantId = tenantId; }
}
